<template>
    <div class="center">
     <table width="801" border="0" cellpadding="0" cellspacing="0" style="width:600.75pt;border-collapse:collapse;table-layout:fixed;">
   <colgroup><col width="105" style="mso-width-source:userset;mso-width-alt:3360;">
   <col width="103" style="mso-width-source:userset;mso-width-alt:3296;">
   <col width="99" style="mso-width-source:userset;mso-width-alt:3168;">
   <col width="105" style="mso-width-source:userset;mso-width-alt:3360;">
   <col width="119" style="mso-width-source:userset;mso-width-alt:3808;">
   <col width="87" style="mso-width-source:userset;mso-width-alt:2784;">
   <col width="96" style="mso-width-source:userset;mso-width-alt:3072;">
   <col width="87" style="mso-width-source:userset;mso-width-alt:2784;">
   </colgroup><tbody><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="38" width="618" colspan="6" rowspan="2" style="height:28.50pt;width:463.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;text-align:center;" x:str="">生产区域动土工作票</td>
    <td class="xl65" width="183" colspan="2" rowspan="2" style="width:137.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;"></td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" style="height:14.25pt;" x:str="">No：</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.bb.rwdId}}</td>
    <td class="xl66" x:str="">编号：</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.bb.num}}</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" style="height:14.25pt;" x:str="">项目名称</td>
    <td class="xl65" colspan="7" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.projectName}}</td>
    <td class="xl65" colspan="7" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="projectName"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" style="height:14.25pt;" x:str="">风电场</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.bb.orgName_dictText}}</td>
    <td class="xl66" x:str="">动土施工单位</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.constructionUnit}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="constructionUnit"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl67" height="38" rowspan="2" style="height:28.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">动图工作<br>负责人</td>
    <td class="xl65" colspan="3" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.workOndutyPerson}}</td>
    <td class="xl65" colspan="3" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="workOndutyPerson"></a-input>
    </td>
    <td class="xl66" x:str="">计划开工时间</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.planStartDate}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间" class="query-group-cust" v-model="planStartDate"></j-date>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" x:str="">计划完工时间</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.planEndDate}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间" class="query-group-cust" v-model="planEndDate"></j-date>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl67" height="38" rowspan="2" style="height:28.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">动土区域<br>及工作内容</td>
    <td class="xl65" colspan="3" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.bb.workDetail}}</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">弃土地点</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.spoilSite}}</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="spoilSite"></a-input>
    </td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">弃土地点</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.spoilSite2}}</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="spoilSite2"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="19" colspan="8" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">相关部门、专业提供的安全措施（注意事项）</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl67" height="76" rowspan="4" style="height:57.00pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">动土区域地<br>下设施确认</td>
    <td class="xl67" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">风电场负责<br>人意见</td>
    <td class="xl65" colspan="4" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.farmOnduty}}</td>
    <td class="xl65" colspan="4" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
         <a-textarea
            v-model="farmOnduty"
            :auto-size="{ minRows: 3, maxRows: 5 }"
            />
    </td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">签名</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.farmOndutySign}}</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="farmOndutySign"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl67" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">生产部门<br>负责人意见</td>
    <td class="xl65" colspan="4" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.productionOnduty}}</td>
    <td class="xl65" colspan="4" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-textarea
            v-model="productionOnduty"
            :auto-size="{ minRows: 3, maxRows: 5 }"
            />
    </td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">签名</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.productionSign}}</td>
    <td class="xl65" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="productionSign"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">安全措施（放坡、支护、地下设施保护等）：</td>
    <td class="xl65" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">执行情况（√）</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl65" height="152" colspan="4" rowspan="8" style="height:114.00pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.safetyMeasures}}</td>
    <td class="xl65" height="152" colspan="4" rowspan="8" style="height:114.00pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-textarea
            v-model="safetyMeasures"
            :auto-size="{ minRows: 7, maxRows: 7 }"
            />
    </td>
    <td class="xl68" colspan="4" rowspan="8" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.bb.implementation}}</td>
    <td class="xl68" colspan="4" rowspan="8" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
         <a-textarea
            v-model="implementation"
            :auto-size="{ minRows: 7, maxRows: 7 }"
            />
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" style="height:14.25pt;" x:str="">签发人</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!sign">{{this.bb.ticketAsignPerson}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="sign">
        <a-input v-model="ticketAsignPerson"></a-input>
    </td>
    <td class="xl66" x:str="">签发时间</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!sign">{{this.bb.ticketAssignDate}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="sign">
        <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间" class="query-group-cust" v-model="ticketAssignDate"></j-date>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" style="height:14.25pt;" x:str="">安监部</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.bb.ssdPerson}}</td>
    <td class="xl66" x:str="">时间</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.bb.ssdDate}}</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" style="height:14.25pt;" x:str="">动土许可人</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!pending">{{this.bb.permmitSign}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="pending">
        <a-input v-model="permmitSign"></a-input>
    </td>
    <td class="xl66" x:str="">批准动土时间</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!pending">{{this.bb.approvalTime}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="pending">
       <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间" class="query-group-cust" v-model="approvalTime"></j-date>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" style="height:14.25pt;" x:str="">动土结束时间</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!ing">{{this.bb.endTime}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="ing">
        <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间" class="query-group-cust" v-model="endTime"></j-date>
    </td>
    <td class="xl66" x:str="">动土工作负责人</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!ing">{{this.bb.workOndutyPerson1}}</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="ing">
        <a-input v-model="workOndutyPerson1"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl69" height="38" colspan="8" rowspan="2" style="height:28.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="" v-if="!ing">备注：{{this.bb.remake}}<br>对应工作票编号：{{this.bb.workNum}}</td>
        <td class="xl69" height="38" colspan="8" rowspan="2" style="height:28.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="" v-if="ing">备注：
            <a-textarea
            v-model="remake"
            :auto-size="{ minRows: 3, maxRows: 5 }"
            style="width:740px;"
            />
        <br>对应工作票编号：<a-input v-model="workNum" style="width:600px;"></a-input></td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="19" colspan="2" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">集控值班负责人</td>
    <td class="xl65" colspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;"></td>
    <td class="xl66" x:str="">接票时间</td>
    <td class="xl65" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;"></td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl65" height="19" colspan="2" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">工作票结束时间</td>
    <td class="xl65" colspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.bb.ticketOverDate}}</td>
    <td class="xl66" x:str="">集控值班负责人</td>
    <td class="xl70" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;"></td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl65" height="19" colspan="2" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">工作负责人闭环管理确认</td>
    <td class="xl66" x:str="">终结确认时间</td>
    <td class="xl65" colspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!end">{{this.bb.ticketClosedDate}}</td>
     <td class="xl65" colspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="end">
         <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间" class="query-group-cust" v-model="ticketClosedDate"></j-date>
     </td>
    <td class="xl66" x:str="">工作负责人</td>
    <td class="xl65" colspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!end">{{this.bb.workOndutyPerson2}}</td>
    <td class="xl65" colspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="end">
        <a-input v-model="workOndutyPerson2"></a-input>
    </td>
   </tr>
  </tbody></table>
    </div>
</template>
<script>
import JDate from '@/components/jeecg/JDate.vue'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag.vue'
import store from '@/store'
import{Time} from '@/utils/time'
import { httpAction, getAction,postAction,putAction } from '@/api/manage'
export default {
     components: {
      JDate,
      JDictSelectTag,
      JMultiSelectTag,
    },
    data(){
        return{
         draft:false,
         projectName:'',
         constructionUnit:'',
         workOndutyPerson:store.getters.userInfo.realname,
         planStartDate:'',
         planEndDate:'',
         spoilSite:'',
         spoilSite2:'',
         farmOnduty:'',
         farmOndutySign:'',
         productionOnduty:'',
         productionSign:'',
         safetyMeasures:'',
         implementation:'',
         sign:false,
         ticketAsignPerson:store.getters.userInfo.realname,
         ticketAssignDate:Time(),
         pending:false,
         permmitSign:store.getters.userInfo.realname,
         approvalTime:Time(),
         ing:false,
         endTime:Time(),
         workOndutyPerson1:store.getters.userInfo.realname,
         remake:'',
         workNum:'',
         end:false,
         ticketClosedDate:Time(),
         workOndutyPerson2:store.getters.userInfo.realname,

        }
    },
    props:['bb'], 
    methods:{
       refresh(){
            return this.bb.type
        },
        back(){
             var obj = {}
             if(this.draft == true){
                 obj = {
                    id:this.bb.id,
                    projectName:this.projectName,
                    constructionUnit:this.constructionUnit,
                    workOndutyPerson:this.workOndutyPerson,
                    planStartDate:this.planStartDate,
                    planEndDate:this.planEndDate,
                    spoilSite:this.spoilSite,
                    spoilSite2:this.spoilSite2,
                    farmOnduty:this.farmOnduty,
                    farmOndutySign:this.farmOndutySign,
                    productionOnduty:this.productionOnduty,
                    productionSign:this.productionSign,
                    safetyMeasures:this.safetyMeasures,
                    implementation:this.implementation,
                 }
               
             }else if(this.sign == true){
                 obj = {
                     id:this.bb.id,
                     ticketAsignPerson:this.ticketAsignPerson,
                     ticketAssignDate:this.ticketAssignDate,
                 }
             }else if(this.pending == true){
                 obj = {
                     id:this.bb.id,
                     permmitSign:this.permmitSign,
                    approvalTime:this.approvalTime,
                 }
             }else if(this.ing == true){
                 obj = {
                     id:this.bb.id,
                    endTime:this.endTime,
                    workOndutyPerson1:this.workOndutyPerson1,
                    remake:this.remake,
                    workNum:this.workNum,

                 }
             }else if(this.end == true){
                 obj = {
                     id:this.bb.id,
                    ticketClosedDate:this.ticketClosedDate,
                    workOndutyPerson2:this.workOndutyPerson2,
                 }
             }
              return obj
        }
    },
    mounted(){
        if(this.bb.planEndDate == null){
            this.draft = true
        }
        if(this.bb.planEndDate != null && this.bb.ticketAsignPerson == null){
            this.sign = true
        }
        if(this.bb.ticketAsignPerson != null && this.bb.permmitSign == null){
            this.pending = true
        }
        if(this.bb.permmitSign != null && this.bb.workOndutyPerson1 == null){
            this.ing = true
        }
        if(this.bb.workOndutyPerson1 != null && this.bb.workOndutyPerson2 == null){
            this.end = true
        }
        
    }
}
</script>
<style scoped>
td{
    padding-top: 1px;
    padding-right: 1px;
    padding-left: 1px;
    vertical-align: middle;
    white-space: nowrap;
    color: windowtext;
    font-size: 12pt;
    font-weight: 400;
    font-style: normal;
    font-family: 宋体;
    text-decoration: none;
    border: 1px solid #000;
     }
.center{
    width:801px;
     background-color: #E5EDF0 !important;
     } 

</style>